.class public final Llt/noframe/gpsfarmguide/gps/AppLocationProvider;
.super Lcom/google/android/gms/location/LocationCallback;
.source "AppLocationProvider.kt"

# interfaces
.implements Landroid/location/LocationListener;
.implements Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;
.implements Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;,
        Llt/noframe/gpsfarmguide/gps/AppLocationProvider$Companion;
    }
.end annotation

.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\nAppLocationProvider.kt\nKotlin\n*S Kotlin\n*F\n+ 1 AppLocationProvider.kt\nlt/noframe/gpsfarmguide/gps/AppLocationProvider\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,257:1\n1582#2,2:258\n*E\n*S KotlinDebug\n*F\n+ 1 AppLocationProvider.kt\nlt/noframe/gpsfarmguide/gps/AppLocationProvider\n*L\n181#1,2:258\n*E\n"
.end annotation


# static fields
.field public static final Companion:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$Companion;


# instance fields
.field private final context:Landroid/app/Application;

.field private currentLevel:I

.field private final fusedProvider:Lcom/google/android/gms/location/FusedLocationProviderClient;

.field private final locationsources:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;",
            ">;"
        }
    .end annotation
.end field

.field private final mainLocationSource:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

.field private mainLocationSourceEnabled:Z

.field private final manager:Landroid/location/LocationManager;

.field private minRefreshDistance:F

.field private refreshRate:D

.field private status:I

.field private uiThreadRunner:Landroid/os/Handler;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    new-instance v0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$Companion;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V

    sput-object v0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->Companion:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$Companion;

    return-void
.end method

.method public constructor <init>(Landroid/app/Application;D)V
    .locals 1

    const-string v0, "context"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 35
    invoke-direct {p0}, Lcom/google/android/gms/location/LocationCallback;-><init>()V

    .line 62
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->locationsources:Ljava/util/List;

    .line 64
    invoke-static {p1}, Lcom/google/android/gms/location/LocationServices;->getFusedLocationProviderClient(Landroid/content/Context;)Lcom/google/android/gms/location/FusedLocationProviderClient;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->fusedProvider:Lcom/google/android/gms/location/FusedLocationProviderClient;

    const-string v0, "location"

    .line 66
    invoke-virtual {p1, v0}, Landroid/app/Application;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    if-eqz v0, :cond_0

    check-cast v0, Landroid/location/LocationManager;

    iput-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    .line 68
    iput-object p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->context:Landroid/app/Application;

    .line 72
    new-instance p1, Landroid/os/Handler;

    invoke-direct {p1}, Landroid/os/Handler;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->uiThreadRunner:Landroid/os/Handler;

    .line 74
    new-instance p1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

    invoke-direct {p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSource:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

    const/4 p1, 0x1

    .line 76
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSourceEnabled:Z

    .line 78
    iput-wide p2, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    const/high16 p2, 0x3f800000    # 1.0f

    .line 80
    iput p2, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->minRefreshDistance:F

    .line 82
    iput p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    .line 88
    sget-object p1, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    invoke-virtual {p1}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object p1

    invoke-virtual {p1}, Llt/farmis/libraries/externalgps/ExternalGPS;->getStatusListeners()Ljava/util/List;

    move-result-object p1

    invoke-interface {p1, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 89
    sget-object p1, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    invoke-virtual {p1}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object p1

    invoke-virtual {p1}, Llt/farmis/libraries/externalgps/ExternalGPS;->getLocationListeners()Ljava/util/List;

    move-result-object p1

    invoke-interface {p1, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void

    .line 66
    :cond_0
    new-instance p1, Lkotlin/TypeCastException;

    const-string p2, "null cannot be cast to non-null type android.location.LocationManager"

    invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public static final synthetic access$getCurrentLevel$p(Llt/noframe/gpsfarmguide/gps/AppLocationProvider;)I
    .locals 0

    .line 34
    iget p0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    return p0
.end method


# virtual methods
.method public final activate(I)V
    .locals 14
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    const-string v0, "AppLocationProvider"

    const-string v1, "ACTIVATE GPS CALLED"

    .line 98
    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 99
    iput p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    .line 101
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    invoke-virtual {v0, p0}, Landroid/location/LocationManager;->removeUpdates(Landroid/location/LocationListener;)V

    .line 102
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->fusedProvider:Lcom/google/android/gms/location/FusedLocationProviderClient;

    invoke-virtual {v0, p0}, Lcom/google/android/gms/location/FusedLocationProviderClient;->removeLocationUpdates(Lcom/google/android/gms/location/LocationCallback;)Lcom/google/android/gms/tasks/Task;

    .line 104
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->isExternalConnected()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 105
    sget-object p1, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    invoke-virtual {p1}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object p1

    iget-wide v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    invoke-virtual {p1, v0, v1}, Llt/farmis/libraries/externalgps/ExternalGPS;->setSamplingRate(D)V

    return-void

    .line 109
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    const-string v1, "gps"

    invoke-virtual {v0, v1}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result v0

    const/16 v1, 0x3e8

    if-eqz v0, :cond_3

    const/4 v0, 0x2

    const/4 v2, 0x3

    if-ge p1, v0, :cond_1

    .line 112
    iget-object v3, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    int-to-double v0, v1

    iget-wide v4, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    int-to-double v6, v2

    invoke-static {v6, v7}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v4, v6

    invoke-static {v0, v1}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v0, v4

    double-to-long v5, v0

    const/high16 v7, 0x40000000    # 2.0f

    const-string v4, "gps"

    move-object v8, p0

    invoke-virtual/range {v3 .. v8}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V

    goto :goto_0

    :cond_1
    if-ge p1, v2, :cond_2

    .line 114
    iget-object v8, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    int-to-double v0, v1

    iget-wide v2, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    const-wide/high16 v4, 0x3ff8000000000000L    # 1.5

    div-double/2addr v2, v4

    invoke-static {v0, v1}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v0, v2

    double-to-long v10, v0

    const/high16 v12, 0x3f800000    # 1.0f

    const-string v9, "gps"

    move-object v13, p0

    invoke-virtual/range {v8 .. v13}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V

    goto :goto_0

    .line 116
    :cond_2
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->manager:Landroid/location/LocationManager;

    int-to-double v1, v1

    iget-wide v3, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    invoke-static {v1, v2}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v1, v3

    double-to-long v2, v1

    const/high16 v4, 0x3f800000    # 1.0f

    const-string v1, "gps"

    move-object v5, p0

    invoke-virtual/range {v0 .. v5}, Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String;JFLandroid/location/LocationListener;)V

    :goto_0
    return-void

    .line 120
    :cond_3
    invoke-static {}, Lcom/google/android/gms/location/LocationRequest;->create()Lcom/google/android/gms/location/LocationRequest;

    move-result-object p1

    int-to-double v0, v1

    .line 121
    iget-wide v2, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    invoke-static {v0, v1}, Ljava/lang/Double;->isNaN(D)Z

    div-double v2, v0, v2

    double-to-long v2, v2

    invoke-virtual {p1, v2, v3}, Lcom/google/android/gms/location/LocationRequest;->setInterval(J)Lcom/google/android/gms/location/LocationRequest;

    .line 122
    iget-wide v2, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    invoke-static {v0, v1}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v0, v2

    double-to-long v0, v0

    invoke-virtual {p1, v0, v1}, Lcom/google/android/gms/location/LocationRequest;->setFastestInterval(J)Lcom/google/android/gms/location/LocationRequest;

    const/16 v0, 0x64

    .line 123
    invoke-virtual {p1, v0}, Lcom/google/android/gms/location/LocationRequest;->setPriority(I)Lcom/google/android/gms/location/LocationRequest;

    .line 125
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->fusedProvider:Lcom/google/android/gms/location/FusedLocationProviderClient;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-virtual {v0, p1, p0, v1}, Lcom/google/android/gms/location/FusedLocationProviderClient;->requestLocationUpdates(Lcom/google/android/gms/location/LocationRequest;Lcom/google/android/gms/location/LocationCallback;Landroid/os/Looper;)Lcom/google/android/gms/tasks/Task;

    return-void
.end method

.method public final getLastLocation(Lkotlin/jvm/functions/Function1;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Landroid/location/Location;",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    const-string v0, "unit"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 158
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->context:Landroid/app/Application;

    const-string v1, "android.permission.ACCESS_FINE_LOCATION"

    invoke-static {v0, v1}, Landroidx/core/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I

    move-result v0

    if-nez v0, :cond_0

    .line 159
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->context:Landroid/app/Application;

    const-string v1, "android.permission.ACCESS_COARSE_LOCATION"

    invoke-static {v0, v1}, Landroidx/core/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I

    move-result v0

    if-nez v0, :cond_0

    .line 160
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->fusedProvider:Lcom/google/android/gms/location/FusedLocationProviderClient;

    const-string v1, "fusedProvider"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/google/android/gms/location/FusedLocationProviderClient;->getLastLocation()Lcom/google/android/gms/tasks/Task;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$getLastLocation$1;

    invoke-direct {v1, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$getLastLocation$1;-><init>(Lkotlin/jvm/functions/Function1;)V

    invoke-virtual {v0, v1}, Lcom/google/android/gms/tasks/Task;->addOnCompleteListener(Lcom/google/android/gms/tasks/OnCompleteListener;)Lcom/google/android/gms/tasks/Task;

    :cond_0
    return-void
.end method

.method public final getLocationsources()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;",
            ">;"
        }
    .end annotation

    .line 62
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->locationsources:Ljava/util/List;

    return-object v0
.end method

.method public final getMainLocationSource()Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;
    .locals 1

    .line 74
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSource:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

    return-object v0
.end method

.method public final isExternalConnected()Z
    .locals 2

    .line 85
    sget-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object v0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS;->getExternalGPSState()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    sget-object v1, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method

.method public onLocationChanged(Landroid/location/Location;)V
    .locals 5

    if-nez p1, :cond_0

    return-void

    .line 174
    :cond_0
    invoke-virtual {p1}, Landroid/location/Location;->getLatitude()D

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Math;->abs(D)D

    move-result-wide v0

    const-wide v2, 0x3e112e0be826d695L    # 1.0E-9

    cmpg-double v4, v0, v2

    if-gez v4, :cond_1

    invoke-virtual {p1}, Landroid/location/Location;->getLongitude()D

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Math;->abs(D)D

    move-result-wide v0

    cmpg-double v4, v0, v2

    if-gez v4, :cond_1

    return-void

    .line 178
    :cond_1
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSourceEnabled:Z

    if-eqz v0, :cond_2

    .line 179
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSource:Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;->getLocationListener()Lcom/google/android/gms/maps/LocationSource$OnLocationChangedListener;

    move-result-object v0

    if-eqz v0, :cond_2

    invoke-interface {v0, p1}, Lcom/google/android/gms/maps/LocationSource$OnLocationChangedListener;->onLocationChanged(Landroid/location/Location;)V

    .line 181
    :cond_2
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->locationsources:Ljava/util/List;

    .line 258
    invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_3
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_4

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;

    .line 182
    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;->getActive()Z

    move-result v2

    if-eqz v2, :cond_3

    .line 183
    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$AppCustomLocationSource;->getLocationListener()Lcom/google/android/gms/maps/LocationSource$OnLocationChangedListener;

    move-result-object v1

    if-eqz v1, :cond_3

    invoke-interface {v1, p1}, Lcom/google/android/gms/maps/LocationSource$OnLocationChangedListener;->onLocationChanged(Landroid/location/Location;)V

    goto :goto_0

    .line 186
    :cond_4
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    const-string v1, "Data.getInstance()"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Llt/noframe/gpsfarmguide/Data;->setLastLocation(Landroid/location/Location;)V

    return-void
.end method

.method public onLocationResult(Lcom/google/android/gms/location/LocationResult;)V
    .locals 1

    .line 130
    invoke-super {p0, p1}, Lcom/google/android/gms/location/LocationCallback;->onLocationResult(Lcom/google/android/gms/location/LocationResult;)V

    if-eqz p1, :cond_0

    .line 131
    invoke-virtual {p1}, Lcom/google/android/gms/location/LocationResult;->getLastLocation()Landroid/location/Location;

    move-result-object v0

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    if-eqz v0, :cond_1

    .line 132
    invoke-virtual {p1}, Lcom/google/android/gms/location/LocationResult;->getLastLocation()Landroid/location/Location;

    move-result-object p1

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->onLocationChanged(Landroid/location/Location;)V

    :cond_1
    return-void
.end method

.method public onLocationUpdate(Llt/farmis/libraries/externalgps/GPSLocation;)V
    .locals 2

    const-string v0, "location"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 235
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->uiThreadRunner:Landroid/os/Handler;

    new-instance v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onLocationUpdate$1;

    invoke-direct {v1, p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onLocationUpdate$1;-><init>(Llt/noframe/gpsfarmguide/gps/AppLocationProvider;Llt/farmis/libraries/externalgps/GPSLocation;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public onProviderDisabled(Ljava/lang/String;)V
    .locals 1
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    const-string v0, "gps"

    .line 206
    invoke-static {v0, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 207
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->isExternalConnected()Z

    move-result v0

    if-nez v0, :cond_0

    iget v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    :cond_0
    const-string v0, "external_gps_provider"

    .line 209
    invoke-static {v0, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    .line 210
    iget p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    :cond_1
    return-void
.end method

.method public onProviderEnabled(Ljava/lang/String;)V
    .locals 1
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    const-string v0, "gps"

    .line 199
    invoke-static {v0, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 200
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->isExternalConnected()Z

    move-result p1

    if-nez p1, :cond_0

    iget p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    :cond_0
    return-void
.end method

.method public onStatusChanged(Ljava/lang/String;ILandroid/os/Bundle;)V
    .locals 0
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    const-string p3, "gps"

    .line 192
    invoke-static {p3, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    if-eqz p2, :cond_0

    const/4 p1, 0x1

    if-ne p2, p1, :cond_1

    .line 193
    :cond_0
    iget p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    :cond_1
    return-void
.end method

.method public onStatusChanged(Llt/farmis/libraries/externalgps/providers/Status;)V
    .locals 2
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    const-string v0, "status"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 216
    sget-object v0, Llt/farmis/libraries/externalgps/providers/Status;->DISCONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    if-eq p1, v0, :cond_0

    sget-object v0, Llt/farmis/libraries/externalgps/providers/Status;->IO_EXCEPTION:Llt/farmis/libraries/externalgps/providers/Status;

    if-ne p1, v0, :cond_1

    .line 217
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->uiThreadRunner:Landroid/os/Handler;

    new-instance v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$1;-><init>(Llt/noframe/gpsfarmguide/gps/AppLocationProvider;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 222
    :cond_1
    sget-object v0, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    if-ne p1, v0, :cond_2

    .line 223
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->uiThreadRunner:Landroid/os/Handler;

    new-instance v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$2;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$2;-><init>(Llt/noframe/gpsfarmguide/gps/AppLocationProvider;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 227
    :cond_2
    new-instance v0, Ljava/lang/Exception;

    invoke-direct {v0}, Ljava/lang/Exception;-><init>()V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 228
    iget-object v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->uiThreadRunner:Landroid/os/Handler;

    new-instance v1, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$3;

    invoke-direct {v1, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider$onStatusChanged$3;-><init>(Llt/farmis/libraries/externalgps/providers/Status;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    return-void
.end method

.method public final setRefreshRate(F)V
    .locals 2
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "MissingPermission"
        }
    .end annotation

    float-to-double v0, p1

    .line 253
    iput-wide v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->refreshRate:D

    .line 254
    iget p1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->currentLevel:I

    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    return-void
.end method

.method public final startFree()V
    .locals 1

    const/4 v0, 0x1

    .line 152
    iput v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->status:I

    .line 153
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSourceEnabled:Z

    .line 154
    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    return-void
.end method

.method public final startMeasuring()V
    .locals 2

    const/4 v0, 0x2

    .line 145
    iput v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->status:I

    const/4 v1, 0x1

    .line 146
    iput-boolean v1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSourceEnabled:Z

    .line 147
    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    return-void
.end method

.method public final startNavigation()V
    .locals 2

    const/4 v0, 0x3

    .line 138
    iput v0, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->status:I

    const/4 v1, 0x0

    .line 139
    iput-boolean v1, p0, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->mainLocationSourceEnabled:Z

    .line 140
    invoke-virtual {p0, v0}, Llt/noframe/gpsfarmguide/gps/AppLocationProvider;->activate(I)V

    return-void
.end method
